#include "event.h"
#include "attribute.h"

using namespace bd;

Event::Event(EventType type):_eventType(type),_data(0),_target(0),errorCode("RSP000000")
{

}

Event::~Event()
{
	
    if (this->_data != NULL)
	{
        delete _data;
		_data = NULL;
	}
}

Attribute* Event::getTarget() const
{
    return this->_target;
}

EventType Event::getEventType() const
{
    return this->_eventType;
}

boost::any* Event::getData() const
{
    return this->_data;
}

void Event::setData(boost::any* value)
{
    this->_data = value;
}

std::string Event::getKeyValue()
{
	return this->_keyValue;
}
		
void Event::setKeyValue(std::string key)
{
	this->_keyValue = key;
}

int Event::getKeyCode()
{
	return this->keyCode;
}
		
void Event::setKeyCode(int keyCode)
{
	this->keyCode = keyCode;
}
			
void Event::setTarget(Attribute* attri)
{
	this->_target = attri;
}